package com.bedpotato.thread;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.bedpotato.constants.ProxyClawerConstants;
import com.bedpotato.po.ProxyPO;
import com.bedpotato.service.ProxyTestService;

/**
 * 判断代理是否可用的线程
 * 
 * @author LiALuN
 * 
 */
@Component
@Scope(value="prototype")
public class ProxyTestThread implements Runnable {
	ProxyPO proxyPO;

	@Override
	public void run() {
		boolean b = ProxyClawerConstants.applicationContext.getBean(
				"proxyTestService", ProxyTestService.class).isProxyAvailable(
				proxyPO);
		System.out.println("IP:" + proxyPO.getIp() + " boolean:" + b);
	}

	public void setProxyPO(ProxyPO proxyPO) {
		this.proxyPO = proxyPO;
	}

}
